<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./../template/WorkspaceTemplate.xhtml">

    <ui:define name="top">
        
    </ui:define>

    <ui:define name="left">
       
    </ui:define>

    <ui:define name="right">
       
    </ui:define>

    <ui:define name="content">
        <h:form>
            <p:panel id="panel" header="Sales Quotation">
                <p:ajaxStatus style="width: 16px;height: 16px;">
                    <f:facet name="start">
                        <h:graphicImage value="./../images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:messages />
                <h:panelGrid columns="4" cellpadding="10">
                    <h:outputLabel for="siNumber" style="font-weight: bold" value="Sales Inquiry #: "/>
                    <h:outputText value="#{slManagerBean.salesInquiry.siNumber}"/>
                    
                    <h:outputLabel for="rfiNumber" style="font-weight: bold" value="Reference Order #: "/>
                    <h:outputText value="#{slManagerBean.salesInquiry.rfiNumber}"/>

                    <h:outputLabel for="customerIdStr" style="font-weight: bold" value="Client ID: "/>
                    <h:outputText value="#{slManagerBean.salesInquiry.salesLead.clientId}"/>
            
                    
                    <h:outputLabel for="date" style="font-weight: bold" value="Date: "/>
                    <h:outputText id="date" value="#{slManagerBean.salesInquiry.dateStr}"/> 
                  

                    <h:outputLabel for="currency" style="font-weight: bold" value="Select SGD for currency: "/>
                    <h:outputText value="#{slManagerBean.salesInquiry.currency}"/>
                
                </h:panelGrid>
                <p:dataTable var="oneIL" value="#{slManagerBean.salesInquiry.orderItems}">
                    <p:column headerText="Product Type">
                        <h:outputText value="#{oneIL.product.productType}"/>
                    </p:column>
                    <p:column headerText="Unit Price">
                        <h:outputText value="#{oneIL.product.wsUnitPrice}"/>
                    </p:column>
                    <p:column headerText="Quantity Ordered">
                        <h:outputText value="#{oneIL.qtyOrdered}"/>
                    </p:column>
                    <p:column headerText="Order Discount">
                    <h:outputText value="#{oneIL.orderDiscountGroup.wsOrderDiscount}"/>
                    </p:column>
                    <p:column headerText="Member Discount">
                        <h:outputText value="#{oneIL.memberDiscount}"/>
                    </p:column>
                    <p:column headerText="Subtotal">
                    <h:outputText value="#{oneIL.subTotal}"/>
                    </p:column>
                </p:dataTable>
                
            <h:panelGrid columns ="2" cellpadding="10">
                <h:outputLabel for="total" style="font-weight: bold" value="total: "/>
                <h:outputText id="total" value="#{slManagerBean.salesInquiry.total}"/>
            </h:panelGrid>
                
                <p:commandButton id="button" value="Confirm and Send" ajax="false" action="#{slManagerBean.persistSalesInquiry}"/>
            </p:panel>
             <p:commandLink id="createSalesQuotation" value="Create Sales Quotation" ajax="false" action="#{sqManagerBean.test()}"/>

        </h:form>
    </ui:define>

    <ui:define name="bottom">
       
    </ui:define>

</ui:composition>
